package club.banyuan.demo;

import java.util.Scanner;

/**
 * @author edz
 * @version 1.0
 * @date 2020/11/9 8:15 下午
 */
public class Practice {

    public static void main(String[] args) {
        while (true) {
            Scanner sc = new Scanner(System.in);
//        int m = sc.nextInt();
//        if(m>12||m<1){
//            System.out.println("输入数据有误，重新输入。。。");
//        }else if(m==3||m==4||m==5){
//            System.out.println("春季");
//        }else if(m==6||m==7||m==8){
//            System.out.println("夏季");
//        }else if(m==9||m==10||m==11){
//            System.out.println("秋季");
//        }else {
//            System.out.println("冬季");

            System.out.println("请输入年份");
            int year = sc.nextInt();
            System.out.println("请输入月份:");
            int month = sc.nextInt();
            System.out.println("请输入几号:");
            int date = sc.nextInt();
            int sum = 0;
            char a = ' ';
            char b = ' ';


            //1 3  5 7 8 10 12  31天
            //4 6 9 11 30天
            //2 闰年  29天
            if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
                System.out.println(year + "是闰年");
                switch (month - 1) {
                    case 11:
                        sum = sum + 30;
                    case 10:
                        sum = sum + 31;
                    case 9:
                        sum = sum + 30;
                    case 8:
                        sum = sum + 31;
                    case 7:
                        sum = sum + 31;
                    case 6:
                        sum = sum + 30;
                    case 5:
                        sum = sum + 31;
                    case 4:
                        sum = sum + 30;
                    case 3:
                        sum = sum + 31;
                    case 2:
                        sum = sum + 29;
                    case 1:
                        sum = sum + 31;
                    case 0:
                        sum = sum + date;
                        break;
                    default:
                        sum = 0;
                        break;

                }
                System.out.println(year + "年" + month + "月" + date + "日" + "是" + year + "年的第" + sum + "天");
            } else {
                System.out.println(year + "不是闰年");
                switch (month - 1) {
                    case 11:
                        sum = sum + 30;
                    case 10:
                        sum = sum + 31;
                    case 9:
                        sum = sum + 30;
                    case 8:
                        sum = sum + 31;
                    case 7:
                        sum = sum + 31;
                    case 6:
                        sum = sum + 30;
                    case 5:
                        sum = sum + 31;
                    case 4:
                        sum = sum + 30;
                    case 3:
                        sum = sum + 31;
                    case 2:
                        sum = sum + 28;
                    case 1:
                        sum = sum + 31;
                    case 0:
                        sum = sum + date;
                        break;
                    default:
                        sum = 0;
                        break;
                }
                System.out.println(year + "年" + month + "月" + date + "日" + "是" + year + "年的第" + sum + "天");
            }
        }
    }

}